package com.mos.util;

/**
 * Package Name: com.mos.util
 * User: grq
 * Date: 2016/4/7
 * Time: 15:21
 * Description:some des here!
 */
public class RandomUtil {

    //随机数
    public static String createRandom(){

        StringBuffer sb=new StringBuffer();

        //追加  当前简写年月日
        sb.append(DateUtils.getSimpleYearAndMonthAndDay());

        //追加 当前时分秒微妙
        sb.append(DateUtils.getHourAndMinAndSecAndMil());

        //生成1000~9999之间的随机数
        sb.append(Math.round(Math.random()*(9999-1000)+1000));

        return sb.toString();
    }

    public static String createUuid(){
        String id=java.util.UUID.randomUUID().toString();
        return id.replace("-", "");
    }

    public static void main(String[] args) {
        System.out.println(createUuid());
    }
}
